home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / gnu / glibc108.gz / glibc108 / glibc-1.08.1 / sysdeps / alpha / setjmp_aux.c < prev    next >
C/C++ Source or Header  |  1992-11-24  |  2KB  |  74 lines

  1. /* Copyright (C) 1992 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3.  
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library General Public License as
  6. published by the Free Software Foundation; either version 2 of the
  7. License, or (at your option) any later version.
  8.  
  9. The GNU C Library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  12. Library General Public License for more details.
  13.  
  14. You should have received a copy of the GNU Library General Public
  15. License along with the GNU C Library; see the file COPYING.LIB.  If
  16. not, write to the Free Software Foundation, Inc., 675 Mass Ave,
  17. Cambridge, MA 02139, USA.  */
  18.  
  19. /*#include <setjmp.h>*/
  20. #include "jmp_buf.h"
  21. #define jmp_buf __jmp_buf
  22.  
  23. #ifndef __GNUC__
  24. #error This file uses GNU C extensions; you must compile with GCC.
  25. #endif
  26.  
  27. register long int
  28.   r9 asm ("$9"), r10 asm ("$10"), r11 asm ("$11"), r12 asm ("$12"),
  29.   r13 asm ("$13"), r14 asm ("$14");
  30.  
  31. register long int *fp asm ("$15"), *sp asm ("$30"), *retpc asm ("$26");
  32.  
  33. #if 1                /* XXX */
  34. register double
  35.   f2 asm ("$f2"), f3 asm ("$f3"), f4 asm ("$f4"), f5 asm ("$f5"),
  36.   f6 asm ("$f6"), f7 asm ("$f7"), f8 asm ("$f8"), f9 asm ("$f9");
  37. #endif
  38.  
  39. /* Save the current program position in ENV and return 0.  */
  40. int
  41. __setjmp_aux (jmp_buf env, long int *sp, long int *fp)
  42. {
  43.   /* Save the integer registers.  */
  44.   env[0].__9 = r9;
  45.   env[0].__10 = r10;
  46.   env[0].__11 = r11;
  47.   env[0].__12 = r12;
  48.   env[0].__13 = r13;
  49.   env[0].__14 = r14;
  50.  
  51. #if 1                /* XXX */
  52.   /* Save the floating point registers.  */
  53.   env[0].__f2 = f2;
  54.   env[0].__f3 = f3;
  55.   env[0].__f4 = f4;
  56.   env[0].__f5 = f5;
  57.   env[0].__f6 = f6;
  58.   env[0].__f7 = f7;
  59.   env[0].__f8 = f8;
  60.   env[0].__f9 = f9;
  61. #endif
  62.  
  63.   /* Save the return address of our caller, where longjmp will jump to.  */
  64.   env[0].__pc = retpc;
  65.  
  66.   /* Save the FP and SP of our caller.  The __setjmp entry point
  67.      simply puts these in the argument register for us to fetch.  */
  68.   env[0].__fp = fp;
  69.   env[0].__sp = sp;
  70.  
  71.   /* Return to the original caller of __setjmp.  */
  72.   return 0;
  73. }
  74.